package com.gxz.controller;

import com.gxz.common.Result;
import com.gxz.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/account")
public class AccountController {
    @Autowired
    private AccountService accountService;

    @GetMapping
    public String transfer() {
        accountService.transfer();
        return "success";
    }

    @GetMapping("{id}")
    public Result testException(@PathVariable Integer id) {
        return accountService.testException(id);
    }


}
